

cc.Class({
    extends: cc.Component,

    properties: {
        lv:0,
        time:0,
        time1:0,
    },

    setInfo(lv){
        this.lv = lv;
    },

    update(dt){
        this.time1+=dt;
        if(this.time1>0.01){
            this.time += 1;
            this.time1 = 0;
            if(this.time<this.lv*5){
                this.node.width+=6;
                this.node.height+=6;
            }else if(this.time==this.lv*5){
                var self = this;
                this.node.runAction(cc.sequence(cc.fadeOut(2), cc.callFunc(function () {            
                    self.node.destroy();
                })))
            }
        }
        this.checkEnemys()
    },
    checkEnemys(){
        for(var i = 0;i<G_wuxingfenghuolu.gameObj.enemyNode.childrenCount;i++){
            var cn = G_wuxingfenghuolu.gameObj.enemyNode.getChildren()[i];
            if(this.node.getBoundingBox().contains(cn.position)){
                cn.getComponent(cn.name).action_jin2(this.lv,this.node.parent)
            }
        }
    },

  


});
